<?php
/**
 * Example_View class
 */
class Sum_View extends Psa_Smarty_View{
	
	/**
	 * Shows form
	 */
	function chat(){
	
		$this->psa_smarty->assign('page_title_text', 'Chat');
		$this->psa_smarty->assign('page_subtitle_text', 'communicate');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('chat.tpl'));
	}
	
	
	/**
	 * Shows form
	 */
	function sum($sum_result = null){
		
		if($sum_result !== null)
			$this->psa_smarty->assign('sum_result', $sum_result);
		
		$this->psa_smarty->assign('page_title_text', 'Sum numbers');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));		
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('sum_form.tpl'));
	}

	
	/**
	 * Shows form
	 */
	function sum_ajax(){
		
		$this->psa_smarty->assign('ajax_form', 1);
		$this->psa_smarty->assign('page_title_text', 'Sum numbers with ajax');
		$this->psa_smarty->assign('page_subtitle_text', 'lalala');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('sum_form.tpl'));
	}
	
	
	/**
	 * Shows result with ajax
	 */
	function sum_result_ajax($sum_result){
		
		$this->psa_smarty->assign('content', $sum_result);
	}
	
	/**
	 * Shows form
	 */
	function test($sum_result = null){

		$this->psa_smarty->assign('page_title_text', 'Test');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));		
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('test.tpl'));
	}
	
	function new_messages_ajax($result){
	
		$this->psa_smarty->assign('content', $result);
	}
	
	/**
	 * Shows form
	 */
	function read_xml($content){
		
		$this->psa_smarty->assign('page_title_text', 'read xml');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $content);
	}
	
	/**
	 * Shows form
	 */
	function restore_transactions($transaction,$amount){
		$this->psa_smarty->assign('transaction', $transaction);
		$this->psa_smarty->assign('amount', $amount);
		$this->psa_smarty->assign('page_title_text', 'Transactions');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('transactionlist.tpl'));
	}
	
	/**
	 * Shows form
	 */
	function restore_transactions2(){
		$this->psa_smarty->assign('page_title_text', 'Transactions');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('transactions.tpl'));
	}
	/**
	 * Shows form
	 */
	function restore_transactions3(){
		$this->psa_smarty->assign('page_title_text', 'Transactions');
		$this->psa_smarty->assign('page_title', $this->psa_smarty->fetch('page_title.tpl'));
		$this->psa_smarty->assign('content', $this->psa_smarty->fetch('transactions2.tpl'));
	}
	
	
	
}
